package org.dragon.configs;

/**
 * Author:     Zhao Yan
 * DateTime:   2023/5/17 10:58
 */
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.serializer.GenericJackson2JsonRedisSerializer;
import org.springframework.data.redis.serializer.RedisSerializer;

@Configuration
public class RedisConfig {

    // 替换默认Redis序列化，默认为JDK序列化器
    @Bean(name = "springSessionDefaultRedisSerializer")
    public RedisSerializer<?> getRedisSerializer() {
        return new GenericJackson2JsonRedisSerializer();
    }
}